/*    
 * Copyright (c) 2013 ISoftStone, Inc.
 * All right reserved.
 *
 * 文件名：      EmailNotificationDaoImpl.java
 * 作者:     Jacky Wang
 * 创建日期： 2013-9-25 下午03:59:02
 * 版本：           
 *
 */
package com.isoftstone.industry.aaa.core.dao.assist.impl;

import java.sql.Timestamp;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import com.isoftstone.industry.persistance.bean.BillingList;
import com.isoftstone.industry.persistance.bean.EmailNotification;
import com.isoftstone.industry.aaa.core.dao.assist.EmailNotificationDaoPlus;
import com.isoftstone.modules.core.utils.DateUtils;

/**
 *
 * @author jacky
 */
public class EmailNotificationDaoImpl implements EmailNotificationDaoPlus
{
	@PersistenceContext 
	private EntityManager em; 
	
	@Override
	public List<EmailNotification> getNeedDeliveredNotification(int start, int limit)
	{
		String hql = "from EmailNotification x where x.delivered=?1";
		Query query = em.createQuery(hql);
		query.setParameter(1, false);
		if (start >= 0 && limit > 0)
		{
			query.setFirstResult(start);
			query.setMaxResults(limit);
		}
		return query.getResultList();
	}

}
